let mongoose = require('mongoose')
let Schema = mongoose.Schema;

let studentSchema = new Schema({
    code : { type : String, match : /^\d{10}$/},
    name : { type : String, match : /^.{1,10}$/ },
    avatar: { type: String, require: true },
    wx_name : { type : String, match : /^.{1,20}$/, required : true },
    openid: { type: String, match : /^.{28}$/, required : true }
})

module.exports = mongoose.model('student', studentSchema)